package com.witker.demo.user.web;

import com.witker.demo.user.entity.User;
import com.witker.demo.user.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * 用户模块的视图控制器
 * Created by BOCAI on 2018/4/19 18:02.
 */
@RestController
@RequestMapping("/user")
public class UserController {

    @Autowired
    private UserService userService;

    /**
     * @return
     */
    @RequestMapping("/list")
    public List<User> hello(@RequestBody User user) {
        List<User> result = null;
        result = userService.list(user);
        return result;
    }
}
